Integrand size = 25, antiderivative size = 179 \[ \int \frac {(c+d \sin (e+f x))^2}{(3+b \sin (e+f x))^3} \, dx=-\frac {\left (18 b c d-9 \left (2 c^2+d^2\right )-b^2 \left (c^2+2 d^2\right )\right ) \arctan \left (\frac {b+3 \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {9-b^2}}\right )}{\left (9-b^2\right )^{5/2} f}+\frac {(b c-3 d)^2 \cos (e+f x)}{2 b \left (9-b^2\right ) f (3+b \sin (e+f x))^2}+\frac {(b c-3 d) \left (9 b c+9 d-4 b^2 d\right ) \cos (e+f x)}{2 b \left (9-b^2\right )^2 f (3+b \sin (e+f x))} \]
[Out]
Time = 0.19 (sec) , antiderivative size = 196, normalized size of antiderivative = 1.09, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.240, Rules used = {2869, 2833, 12, 2739, 632, 210} \[ \int \frac {(c+d \sin (e+f x))^2}{(3+b \sin (e+f x))^3} \, dx=-\frac {\left (-\left (a^2 \left (2 c^2+d^2\right )\right )+6 a b c d-b^2 \left (c^2+2 d^2\right )\right ) \arctan \left (\frac {a \tan \left (\frac {1}{2} (e+f x)\right )+b}{\sqrt {a^2-b^2}}\right )}{f \left (a^2-b^2\right )^{5/2}}+\frac {(b c-a d)^2 \cos (e+f x)}{2 b f \left (a^2-b^2\right ) (a+b \sin (e+f x))^2}+\frac {\left (a^2 d+3 a b c-4 b^2 d\right ) (b c-a d) \cos (e+f x)}{2 b f \left (a^2-b^2\right )^2 (a+b \sin (e+f x))} \]
[In]
[Out]
Rule 12
Rule 210
Rule 632
Rule 2739
Rule 2833
Rule 2869
Rubi steps \begin{align*} \text {integral}& = \frac {(b c-a d)^2 \cos (e+f x)}{2 b \left (a^2-b^2\right ) f (a+b \sin (e+f x))^2}+\frac {\int \frac {-2 b \left (2 b c d-a \left (c^2+d^2\right )\right )+\left (2 a b c d+a^2 d^2-b^2 \left (c^2+2 d^2\right )\right ) \sin (e+f x)}{(a+b \sin (e+f x))^2} \, dx}{2 b \left (a^2-b^2\right )} \\ & = \frac {(b c-a d)^2 \cos (e+f x)}{2 b \left (a^2-b^2\right ) f (a+b \sin (e+f x))^2}+\frac {(b c-a d) \left (3 a b c+a^2 d-4 b^2 d\right ) \cos (e+f x)}{2 b \left (a^2-b^2\right )^2 f (a+b \sin (e+f x))}-\frac {\int \frac {b \left (6 a b c d-a^2 \left (2 c^2+d^2\right )-b^2 \left (c^2+2 d^2\right )\right )}{a+b \sin (e+f x)} \, dx}{2 b \left (a^2-b^2\right )^2} \\ & = \frac {(b c-a d)^2 \cos (e+f x)}{2 b \left (a^2-b^2\right ) f (a+b \sin (e+f x))^2}+\frac {(b c-a d) \left (3 a b c+a^2 d-4 b^2 d\right ) \cos (e+f x)}{2 b \left (a^2-b^2\right )^2 f (a+b \sin (e+f x))}-\frac {\left (6 a b c d-a^2 \left (2 c^2+d^2\right )-b^2 \left (c^2+2 d^2\right )\right ) \int \frac {1}{a+b \sin (e+f x)} \, dx}{2 \left (a^2-b^2\right )^2} \\ & = \frac {(b c-a d)^2 \cos (e+f x)}{2 b \left (a^2-b^2\right ) f (a+b \sin (e+f x))^2}+\frac {(b c-a d) \left (3 a b c+a^2 d-4 b^2 d\right ) \cos (e+f x)}{2 b \left (a^2-b^2\right )^2 f (a+b \sin (e+f x))}-\frac {\left (6 a b c d-a^2 \left (2 c^2+d^2\right )-b^2 \left (c^2+2 d^2\right )\right ) \text {Subst}\left (\int \frac {1}{a+2 b x+a x^2} \, dx,x,\tan \left (\frac {1}{2} (e+f x)\right )\right )}{\left (a^2-b^2\right )^2 f} \\ & = \frac {(b c-a d)^2 \cos (e+f x)}{2 b \left (a^2-b^2\right ) f (a+b \sin (e+f x))^2}+\frac {(b c-a d) \left (3 a b c+a^2 d-4 b^2 d\right ) \cos (e+f x)}{2 b \left (a^2-b^2\right )^2 f (a+b \sin (e+f x))}+\frac {\left (2 \left (6 a b c d-a^2 \left (2 c^2+d^2\right )-b^2 \left (c^2+2 d^2\right )\right )\right ) \text {Subst}\left (\int \frac {1}{-4 \left (a^2-b^2\right )-x^2} \, dx,x,2 b+2 a \tan \left (\frac {1}{2} (e+f x)\right )\right )}{\left (a^2-b^2\right )^2 f} \\ & = -\frac {\left (6 a b c d-a^2 \left (2 c^2+d^2\right )-b^2 \left (c^2+2 d^2\right )\right ) \arctan \left (\frac {b+a \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right )^{5/2} f}+\frac {(b c-a d)^2 \cos (e+f x)}{2 b \left (a^2-b^2\right ) f (a+b \sin (e+f x))^2}+\frac {(b c-a d) \left (3 a b c+a^2 d-4 b^2 d\right ) \cos (e+f x)}{2 b \left (a^2-b^2\right )^2 f (a+b \sin (e+f x))} \\ \end{align*}
Time = 0.97 (sec) , antiderivative size = 176, normalized size of antiderivative = 0.98 \[ \int \frac {(c+d \sin (e+f x))^2}{(3+b \sin (e+f x))^3} \, dx=\frac {\frac {2 \left (\left (18+b^2\right ) c^2-18 b c d+\left (9+2 b^2\right ) d^2\right ) \arctan \left (\frac {b+3 \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {9-b^2}}\right )}{\left (9-b^2\right )^{5/2}}-\frac {(b c-3 d)^2 \cos (e+f x)}{b \left (-9+b^2\right ) (3+b \sin (e+f x))^2}+\frac {\left (-18 b c d-4 b^3 c d-27 d^2+3 b^2 \left (3 c^2+4 d^2\right )\right ) \cos (e+f x)}{b \left (-9+b^2\right )^2 (3+b \sin (e+f x))}}{2 f} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. \(464\) vs. \(2(187)=374\).
Time = 1.35 (sec) , antiderivative size = 465, normalized size of antiderivative = 2.60
method | result | size |
derivativedivides | \(\frac {\frac {\frac {\left (a^{4} d^{2}-6 a^{3} b c d +5 a^{2} b^{2} c^{2}+2 a^{2} b^{2} d^{2}-2 b^{4} c^{2}\right ) \left (\tan ^{3}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{a \left (a^{4}-2 a^{2} b^{2}+b^{4}\right )}-\frac {\left (4 a^{5} c d -4 a^{4} b \,c^{2}-3 a^{4} b \,d^{2}+10 a^{3} b^{2} c d -7 a^{2} b^{3} c^{2}-6 a^{2} b^{3} d^{2}+4 a \,b^{4} c d +2 b^{5} c^{2}\right ) \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{\left (a^{4}-2 a^{2} b^{2}+b^{4}\right ) a^{2}}-\frac {\left (a^{4} d^{2}+10 a^{3} b c d -11 a^{2} b^{2} c^{2}-10 a^{2} b^{2} d^{2}+8 a \,b^{3} c d +2 b^{4} c^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{\left (a^{4}-2 a^{2} b^{2}+b^{4}\right ) a}-\frac {4 a^{3} c d -4 a^{2} b \,c^{2}-3 a^{2} b \,d^{2}+2 a \,b^{2} c d +b^{3} c^{2}}{a^{4}-2 a^{2} b^{2}+b^{4}}}{{\left (\left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right ) a +2 b \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+a \right )}^{2}}+\frac {\left (2 a^{2} c^{2}+d^{2} a^{2}-6 a b c d +b^{2} c^{2}+2 d^{2} b^{2}\right ) \arctan \left (\frac {2 a \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+2 b}{2 \sqrt {a^{2}-b^{2}}}\right )}{\left (a^{4}-2 a^{2} b^{2}+b^{4}\right ) \sqrt {a^{2}-b^{2}}}}{f}\) | \(465\) |
default | \(\frac {\frac {\frac {\left (a^{4} d^{2}-6 a^{3} b c d +5 a^{2} b^{2} c^{2}+2 a^{2} b^{2} d^{2}-2 b^{4} c^{2}\right ) \left (\tan ^{3}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{a \left (a^{4}-2 a^{2} b^{2}+b^{4}\right )}-\frac {\left (4 a^{5} c d -4 a^{4} b \,c^{2}-3 a^{4} b \,d^{2}+10 a^{3} b^{2} c d -7 a^{2} b^{3} c^{2}-6 a^{2} b^{3} d^{2}+4 a \,b^{4} c d +2 b^{5} c^{2}\right ) \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{\left (a^{4}-2 a^{2} b^{2}+b^{4}\right ) a^{2}}-\frac {\left (a^{4} d^{2}+10 a^{3} b c d -11 a^{2} b^{2} c^{2}-10 a^{2} b^{2} d^{2}+8 a \,b^{3} c d +2 b^{4} c^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{\left (a^{4}-2 a^{2} b^{2}+b^{4}\right ) a}-\frac {4 a^{3} c d -4 a^{2} b \,c^{2}-3 a^{2} b \,d^{2}+2 a \,b^{2} c d +b^{3} c^{2}}{a^{4}-2 a^{2} b^{2}+b^{4}}}{{\left (\left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right ) a +2 b \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+a \right )}^{2}}+\frac {\left (2 a^{2} c^{2}+d^{2} a^{2}-6 a b c d +b^{2} c^{2}+2 d^{2} b^{2}\right ) \arctan \left (\frac {2 a \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+2 b}{2 \sqrt {a^{2}-b^{2}}}\right )}{\left (a^{4}-2 a^{2} b^{2}+b^{4}\right ) \sqrt {a^{2}-b^{2}}}}{f}\) | \(465\) |
risch | \(\text {Expression too large to display}\) | \(1294\) |
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 470 vs. \(2 (187) = 374\).
Time = 0.33 (sec) , antiderivative size = 1025, normalized size of antiderivative = 5.73 \[ \int \frac {(c+d \sin (e+f x))^2}{(3+b \sin (e+f x))^3} \, dx=\text {Too large to display} \]
[In]
[Out]
Timed out. \[ \int \frac {(c+d \sin (e+f x))^2}{(3+b \sin (e+f x))^3} \, dx=\text {Timed out} \]
[In]
[Out]
Exception generated. \[ \int \frac {(c+d \sin (e+f x))^2}{(3+b \sin (e+f x))^3} \, dx=\text {Exception raised: ValueError} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 586 vs. \(2 (187) = 374\).
Time = 0.32 (sec) , antiderivative size = 586, normalized size of antiderivative = 3.27 \[ \int \frac {(c+d \sin (e+f x))^2}{(3+b \sin (e+f x))^3} \, dx=\frac {\frac {{\left (2 \, a^{2} c^{2} + b^{2} c^{2} - 6 \, a b c d + a^{2} d^{2} + 2 \, b^{2} d^{2}\right )} {\left (\pi \left \lfloor \frac {f x + e}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (a\right ) + \arctan \left (\frac {a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + b}{\sqrt {a^{2} - b^{2}}}\right )\right )}}{{\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )} \sqrt {a^{2} - b^{2}}} + \frac {5 \, a^{3} b^{2} c^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - 2 \, a b^{4} c^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - 6 \, a^{4} b c d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + a^{5} d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + 2 \, a^{3} b^{2} d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + 4 \, a^{4} b c^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 7 \, a^{2} b^{3} c^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 2 \, b^{5} c^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 4 \, a^{5} c d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 10 \, a^{3} b^{2} c d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 4 \, a b^{4} c d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 3 \, a^{4} b d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 6 \, a^{2} b^{3} d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 11 \, a^{3} b^{2} c^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 2 \, a b^{4} c^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 10 \, a^{4} b c d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 8 \, a^{2} b^{3} c d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - a^{5} d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 10 \, a^{3} b^{2} d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 4 \, a^{4} b c^{2} - a^{2} b^{3} c^{2} - 4 \, a^{5} c d - 2 \, a^{3} b^{2} c d + 3 \, a^{4} b d^{2}}{{\left (a^{6} - 2 \, a^{4} b^{2} + a^{2} b^{4}\right )} {\left (a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 2 \, b \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + a\right )}^{2}}}{f} \]
[In]
[Out]
Time = 11.34 (sec) , antiderivative size = 641, normalized size of antiderivative = 3.58 \[ \int \frac {(c+d \sin (e+f x))^2}{(3+b \sin (e+f x))^3} \, dx=\frac {\mathrm {atan}\left (\frac {\left (\frac {\left (2\,a^4\,b-4\,a^2\,b^3+2\,b^5\right )\,\left (2\,a^2\,c^2+a^2\,d^2-6\,a\,b\,c\,d+b^2\,c^2+2\,b^2\,d^2\right )}{2\,{\left (a+b\right )}^{5/2}\,{\left (a-b\right )}^{5/2}\,\left (a^4-2\,a^2\,b^2+b^4\right )}+\frac {a\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\left (2\,a^2\,c^2+a^2\,d^2-6\,a\,b\,c\,d+b^2\,c^2+2\,b^2\,d^2\right )}{{\left (a+b\right )}^{5/2}\,{\left (a-b\right )}^{5/2}}\right )\,\left (a^4-2\,a^2\,b^2+b^4\right )}{2\,a^2\,c^2+a^2\,d^2-6\,a\,b\,c\,d+b^2\,c^2+2\,b^2\,d^2}\right )\,\left (2\,a^2\,c^2+a^2\,d^2-6\,a\,b\,c\,d+b^2\,c^2+2\,b^2\,d^2\right )}{f\,{\left (a+b\right )}^{5/2}\,{\left (a-b\right )}^{5/2}}-\frac {\frac {4\,a^3\,c\,d-4\,a^2\,b\,c^2-3\,a^2\,b\,d^2+2\,a\,b^2\,c\,d+b^3\,c^2}{a^4-2\,a^2\,b^2+b^4}+\frac {\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\left (a^4\,d^2+10\,a^3\,b\,c\,d-11\,a^2\,b^2\,c^2-10\,a^2\,b^2\,d^2+8\,a\,b^3\,c\,d+2\,b^4\,c^2\right )}{a\,\left (a^4-2\,a^2\,b^2+b^4\right )}-\frac {{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^3\,\left (a^4\,d^2-6\,a^3\,b\,c\,d+5\,a^2\,b^2\,c^2+2\,a^2\,b^2\,d^2-2\,b^4\,c^2\right )}{a\,\left (a^4-2\,a^2\,b^2+b^4\right )}+\frac {{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2\,\left (a^2+2\,b^2\right )\,\left (4\,a^3\,c\,d-4\,a^2\,b\,c^2-3\,a^2\,b\,d^2+2\,a\,b^2\,c\,d+b^3\,c^2\right )}{a^2\,\left (a^4-2\,a^2\,b^2+b^4\right )}}{f\,\left ({\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2\,\left (2\,a^2+4\,b^2\right )+a^2\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4+a^2+4\,a\,b\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^3+4\,a\,b\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\right )} \]
[In]
[Out]